const data = [{
        "id": "1001",
        "name": "值1",
        "value": "111"
    },
    {
        "id": "1001",
        "name": "值1",
        "value": "11111"
    },
    {
        "id": "1002",
        "name": "值2",
        "value": "25462"
    },
    {
        "id": "1002",
        "name": "值2",
        "value": "23131"
    },
    {
        "id": "1002",
        "name": "值2",
        "value": "2315432"
    },
    {
        "id": "1003",
        "name": "值3",
        "value": "333333"
    }
]

var arrData = {
    '1001': 'wo1001',
    '1002': 'wo1002',
    '1003': 'wosj11'
}

var a = ['1001', '1002', '1003']
a.forEach(res => {
    var c = arrData[res]
    debugger;
})


debugger;
var filterArr = [];
var mapObj = {};
data.forEach(res => {
    if (!mapObj[res.id]) {
        debugger;
        //set data 
        filterArr.push({
            id: res.id,
            name: res.name,
            data: [res]
        });
        mapObj[res.id] = res;
    } else {
        debugger;
        filterArr.forEach(filterData => {
            if (filterData.id === res.id) {
                filterData.data.push(res);
            }
        })
    }
});

debugger;

const newData = [];

var arr = [{
    id: '1001',
    name: '值1'
}, {
    id: '1002',
    name: '值2'
}, {
    id: '1003',
    name: '值3'
}]

arr.forEach(res => {
    const v = this.att(res.id, res.name, this.filterData(res.id));
    newData.push(v);
});

function filterData(idData) {
    return data.filter(data => {
        if (data.id === idData) {
            return data;
        }
    })
}

function att(id, name, data) {
    return {
        id: id,
        name: name,
        data: data
    }
}